# -*- coding: utf-8 -*-#
#-------------------------------------------------------------------------------
# 建立者:       加一
# Name:         demo6.03
# Description:  字典的格式化字符串YI
# Author:       加一
# Date:         2019/3/2
#-------------------------------------------------------------------------------

values1 = (1,3,"hello")
str1 = "abc %d, xyz %d, %s world"
print(str1 % values1)

# 定义一个格式化参数字典
values2 = {'title':'极客起源', 'url':'https://geekori.com', 'company':'欧瑞科技'}

# 定义一个字符串模板
str2 = """
<html>
<head>
<title>{title}</title>
<meta chaerst="utf-8"/>
<head>
<body>
<h1>{title}</h1>
<a href="{url}">{company}</a>
</body>
</html>
"""
print(str2.format_map(values2))